package com.entity;

import java.text.SimpleDateFormat;
import java.util.Date;

/**病人**/
public class Patient {
    private String name;
    private String identityId;
    private String patientPwd;
    private int sex;    //1为男性 0为女性
    private String account;
    private String phone;
    private int age;
    private String MICN;   //医保卡号
    private Date bornDate;

    public Patient(){}

    public Patient(String account, String patientPwd){
        this.bornDate = null;
        this.name = null;
        this.age = 0;
        this.MICN = null;
        this.identityId = null;
        this.sex = 0;
        this.phone = null;
        this.account = account;
        this.patientPwd = patientPwd;
    }

    public Patient(String name,String identityId ,String patientPwd ,int sex,String account
    ,String phone, int age, String MICN , Date bornDate){
        this.name = name;
        this.identityId = identityId;
        this.patientPwd = patientPwd;
        this.sex = sex;
        this.account = account;
        this.phone = phone;
        this.age = age;
        this.MICN = MICN;
        this.bornDate = bornDate;

    }

    public String getBornDateFormat(){
        SimpleDateFormat sdf = new SimpleDateFormat();// 格式化时间
        sdf.applyPattern("yyyy-MM-dd");// a为am/pm的标记
        return sdf.format(this.bornDate);
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getAccount() {
        return account;
    }

    public int getSexNum(){
        return this.sex;
    }

    public void setPatientPwd(String patientPwd) {
        this.patientPwd = patientPwd;
    }

    public String getPatientPwd() {
        return patientPwd;
    }

    public void setMICN(String MICN) {
        this.MICN = MICN;
    }

    public void setBornDate(Date bornDate) {
        this.bornDate = bornDate;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void setIdentityId(String identityId) {
        this.identityId = identityId;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public String getPhone() {
        return phone;
    }

    public String getSexString() {
        if(this.sex==1)
            return "男";
        else
            return "女";
    }

    public int getSex() {
        return sex;
    }

    public String getIdentityId() {
        return identityId;
    }

    public String getName() {
        return name;
    }

    public Date getBornDate() {
        return bornDate;
    }

    public String getMICN() {
        return MICN;
    }

    public int sexNum(String comSex) {
        if (comSex.equals("男"))
            return 1;
        else
            return 0;
    }
}
